package com.focusai.efairy.model.dev;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by luo_guangwen on 2017/9/18.
 */

public class DevType implements Serializable{
    public long id;
    public String name;
    public long systemId;

    public DevType(long systemId, long id, String name) {
        this.id = id;
        this.name = name;
        this.systemId = systemId;
    }

    /**
     * 设备类型
     * */
    public static List<DevType> getDevTypes(){
        ArrayList<DevType> list = new ArrayList<>();
        list.add(new DevType(10,1,"DDH5116控制器")); //电气火灾监控系统
        list.add(new DevType(10,2,"DDH5118控制器")); //电气火灾监控系统
        list.add(new DevType(10,7,"4通道测温式探测器"));
        list.add(new DevType(10,8,"智慧安全用电监控探测器(DDH5266W)"));
        list.add(new DevType(10,9,"12通道组合探测器(DDH5268S)"));
        list.add(new DevType(10,10,"2通道组合探测器(DDH5205)"));
        list.add(new DevType(10,11,"1通道电流探测器(DDH5201S)"));
        list.add(new DevType(10,12,"3通道组合探测器(DDH5206)"));
        list.add(new DevType(10,13,"8通道组合探测器(DDH5266)"));
        list.add(new DevType(10,14,"16通道组合探测器(DDH5268W)"));

//        list.add(new DevType(11,160,"可燃气体监控器")); //可燃气体报警系统
//        list.add(new DevType(11,161,"可燃气体监控器"));
//        list.add(new DevType(11,162,"可燃气体监控器"));
//
//        list.add(new DevType(12,16,"出口标志灯"));//应急照明和疏散指示系统
//        list.add(new DevType(12,17,"左向标志灯"));
//        list.add(new DevType(12,18,"右向标志灯"));
//        list.add(new DevType(12,19,"楼层标志灯"));
//        list.add(new DevType(12,20,"左右向标志灯"));
//        list.add(new DevType(12,32,"左右地埋灯"));
//        list.add(new DevType(12,33,"单向地埋灯"));
//        list.add(new DevType(12,48,"照明灯"));
//        list.add(new DevType(12,64,"集中电源"));
//        list.add(new DevType(12,80,"分配电装置"));
//        list.add(new DevType(12,96,"疏散控制器"));
//        list.add(new DevType(12,128,"电子编码器"));
//
//        list.add(new DevType(18,140,"DFW7118 防火门监控器")); //防火门及防火卷帘系统
//        list.add(new DevType(18,141,"DFW7201 双常开防火门模块"));
//        list.add(new DevType(18,142,"DFW7201 单常开防火门模块"));
//        list.add(new DevType(18,143,"DFW7202 双常闭防火门模块"));
//        list.add(new DevType(18,144,"DFW7202 单常闭防火门模块"));
//        list.add(new DevType(18,145,"DFW7306 双门门磁开关"));
//        list.add(new DevType(18,146,"DFW7306 单门门磁开关"));
//        list.add(new DevType(18,147,"DFW7301Z 一体式电动闭门器"));
//        list.add(new DevType(18,148,"输入模块"));

        return list;
    }

    /**
     * 判断设备类型是否需要输入从编码
     */
    public static boolean needInputSecondId(DevType devType){
        if (devType == null)
            return true;
        if (devType.id == 8 ||
                devType.id == 10||
                devType.id == 14){
            return false;
        }
        return true;
    }

    public static String getDevTypeNameById(int systemId,int id){
        if (systemId != 10)
            return "";
        String name = "";
        switch (id){
            case 1:
                name = "DDH5116控制器";
                break;
            case 2:
                name = "DDH5118控制器";
                break;
            case 7:
                name = "4通道测温式探测器";
                break;
            case 8:
                name = "智慧安全用电监控探测器(DDH5266W)";
                break;
            case 9:
                name = "12通道组合探测器(DDH5268S)";
                break;
            case 10:
                name = "2通道组合探测器(DDH5205)";
                break;
            case 11:
                name = "1通道电流探测器(DDH5201S)";
                break;
            case 12:
                name = "3通道组合探测器(DDH5206)";
                break;
            case 13:
                name = "8通道组合探测器(DDH5266)";
                break;
            case 14:
                name = "16通道组合探测器(DDH5268W)";
                break;

            default:

                break;
        }
        return name;
    }
}
